
package org.apache.osgimaker.analyse.algorithm.classfile;

/**
 * Constant of an arbitrary Unicode string.
 * 
 */
public class UTF8Constant extends Constant {
  private final String _string;

  /**
   * Creates an instance for the specified string.
   * @param pool Constant pool.
   * @param string wrapped string.
   */
  public UTF8Constant(Constant[] pool, String string) {
    super(pool);
    _string = string;
  }

  /** Returns the wrapped string. */
  public String getString() {
    return _string;
  }

  /** Returns the constant type and the wrapped string. */
  public String toString() {
    return "CONSTANT_Utf8: " + _string;
  }
} //class